import 'dart:convert';

class LikeAndCollectEntity {
  final String? aid;
  final String? mid;
  final String? cover;
  final String? uid;
  final String? username;
  final String? avatar;
  final String? content;
  final String? name;
  final int? count;
  final int? imgCount;
  final int? collectionCount;
  final int? type;
  final int? createDate;

  LikeAndCollectEntity({
    this.aid,
    this.mid,
    this.cover,
    this.uid,
    this.username,
    this.avatar,
    this.content,
    this.name,
    this.count,
    this.imgCount,
    this.collectionCount,
    this.type,
    this.createDate,
  });

  factory LikeAndCollectEntity.fromJson(Map<String, dynamic> json) {
    return LikeAndCollectEntity(
      aid: json['aid'],
      mid: json['mid'],
      cover: json['cover'],
      uid: json['uid'],
      username: json['username'],
      avatar: json['avatar'],
      content: json['content'],
      name: json['name'],
      count: json['count'],
      imgCount: json['imgCount'],
      collectionCount: json['collectionCount'],
      type: json['type'],
      createDate: json['createDate'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['aid'] = aid;
    data['mid'] = mid;
    data['cover'] = cover;
    data['uid'] = uid;
    data['username'] = username;
    data['avatar'] = avatar;
    data['content'] = content;
    data['name'] = name;
    data['count'] = count;
    data['imgCount'] = imgCount;
    data['collectionCount'] = collectionCount;
    data['type'] = type;
    data['createDate'] = createDate;
    return data;
  }
}

class LikeAndCollectEntityList {
  List<LikeAndCollectEntity>? entities;

  LikeAndCollectEntityList({this.entities});

  factory LikeAndCollectEntityList.fromJson(List<dynamic> json) {
    return LikeAndCollectEntityList(
      entities: json.map((item) => LikeAndCollectEntity.fromJson(item)).toList(),
    );
  }

  List<Map<String, dynamic>> toJson() {
    return entities?.map((item) => item.toJson()).toList() ?? [];
  }
}

